# VS Code 常用快捷键-Windows版

# 常规 【General】

快捷键 英文说明 中文说明
Ctrl+Shift+P, F1 Show Command Palette 显示命令面板
Ctrl+P Quick Open, Go to File… 快速打开,去到文件
Ctrl+Shift+N New window/instance 新窗口/实例
Ctrl+Shift+W Close window/instance 关闭窗口/实例
Ctrl + , User Settings 用户设置
Ctrl+K Ctrl+S Keyboard Shortcuts 键盘快捷键

# 基础编辑 【Basic editing】

快捷键 英文说明 中文说明
Ctrl+X Cut line (empty selection) 剪切行(空选定)
Ctrl+C Copy line (empty selection) 复制行(空选定)
Alt+ ↑ / ↓ Move line up/down 向上/向下移动行
Shift+Alt + ↓ / ↑ Copy line up/down 向上/向下复制行
Ctrl+Shift+K Delete line 删除行
Ctrl+Enter Insert line below 在下方插入行
Ctrl+Shift+Enter Insert line above 在上方插入行
Ctrl+Shift+\ Jump to matching bracket 跳到匹配的括号
Ctrl+] / [ Indent/outdent line 缩进/缩进行
Home / End Go to beginning/end of line 转到行首/行尾
Ctrl+Home Go to beginning of file 转到文件开头
Ctrl+End Go to end of file 转到文件末尾
Ctrl+↑ / ↓ Scroll line up/down 向上/向下滚动行
Alt+PgUp / PgDown Scroll page up/down 向上/向下滚动页面
Ctrl+Shift+[ Fold (collapse) region 折叠(折叠)区域
Ctrl+Shift+] Unfold (uncollapse) region 展开(未折叠)区域
Ctrl+K Ctrl+[ Fold (collapse) all subregions 折叠(未折叠)所有子区域
Ctrl+K Ctrl+] Unfold (uncollapse) all subregions 展开(未折叠)所有子区域
Ctrl+K Ctrl+0 Fold (collapse) all regions 折叠(折叠)所有区域
Ctrl+K Ctrl+J Unfold (uncollapse) all regions 展开(未折叠)所有区域
Ctrl+K Ctrl+C Add line comment 添加行注释
Ctrl+K Ctrl+U Remove line comment 删除行注释
Ctrl+/ Toggle line comment 切换行注释
Shift+Alt+A Toggle block comment 切换块注释
Alt+Z Toggle word wrap 切换换行

# 导航 【Navigation】

快捷键 英文说明 中文说明
Ctrl + T Show all Symbols 显示所有符号
Ctrl + G Go to Line... 转到行...
Ctrl + P Go to File... 转到文件...
Ctrl + Shift + O Go to Symbol... 转到符号...
Ctrl + Shift + M Show Problems panel 显示问题面板
F8 Go to next error or warning 转到下一个错误或警告
Shift + F8 Go to previous error or warning 转到上一个错误或警告
Ctrl + Shift + Tab Navigate editor group history 导航编辑器组历史记录
Alt + ←/→ Go back / forward 返回/前进
Ctrl + M Toggle Tab moves focus 切换选项卡移动焦点

# 搜索和替换 【Search and replace】

快捷键 功能说明 中文说明
Ctrl + F Find 查找
Ctrl + H Replace 替换
F3 / Shift + F3 Find next/previous 查找下一个/上一个
Alt + Enter Select all occurences of Find match 选择查找匹配的所有出现
Ctrl + D Add selection to next Find match 将选择添加到下一个查找匹配
Ctrl + K Ctrl + D Move last selection to next Find match 将最后一个选择移至下一个查找匹配项
Alt + C / R / W Toggle case-sensitive / regex / whole word 切换区分大小写/正则表达式/整个词

# 多光标和选择 【Multi-cursor and selection】

快捷键 英文说明 中文说明
Alt +单击 Insert cursor 插入光标
Ctrl + Alt +↑/↓ Insert cursor above / below 在上/下插入光标
Ctrl + U Undo last cursor operation 撤消上一个光标操作
Shift + Alt + I Insert cursor at end of each line selected 在选定的每一行的末尾插入光标
Ctrl+L Select current line 选择当前行
Ctrl + Shift + L Select all occurrences of current selection 选择当前选择的所有出现
Ctrl + F2 Select all occurrences of current word 选择当前字的所有出现
Shift + Alt + → Expand selection 展开选择
Shift + Alt + ← Shrink selection 缩小选择
Shift + Alt + (拖动鼠标) Column (box) selection 列(框)选择
Ctrl + Shift + Alt +(箭头键) Column (box) selection 列(框)选择
Ctrl + Shift + Alt + PgUp / PgDown Column (box) selection page up/down 列(框)选择页上/下

# 丰富的语言编辑 【Rich languages editing】

快捷键 功能说明 中文说明
Ctrl + Space Trigger suggestion 触发建议
Ctrl + Shift + Space Trigger parameter hints 触发器参数提示
Shift + Alt + F Format document 格式化文档
Ctrl + K Ctrl + F Format selection 格式选定区域
F12 Go to Definition 转到定义
Alt + F12 Peek Definition Peek定义
Ctrl + K F12 Open Definition to the side 打开定义到边
Ctrl + . Quick Fix 快速解决
Shift + F12 Show References 显示引用
F2 Rename Symbol 重命名符号
Ctrl+K Ctrl+X Trim trailing whitespace 修剪尾随空格
Ctrl+K M Change file language 更改文件语言

# 编辑器管理 【Editor management】

快捷键 英文说明 中文说明
Ctrl+F4, Ctrl+W Close editor 关闭编辑器
Ctrl+K F Close folder 关闭文件夹
Ctrl+\ Split editor 拆分编辑器
Ctrl+ 1 / 2 / 3 Focus into 1 st , 2 nd or 3 rd editor group 聚焦到第1,第2或第3编辑器组
Ctrl+K Ctrl+ ←/→ Focus into previous/next editor group 聚焦到上一个/下一个编辑器组
Ctrl+Shift+PgUp / PgDown Move editor left/right 向左/向右移动编辑器
Ctrl+K ← / → Move active editor group 移动活动编辑器组

# 文件管理 【File management】

快捷键 英文说明 中文说明
Ctrl+N New File 新文件
Ctrl+O Open File... 打开文件...
Ctrl+S Save 保存
Ctrl+Shift+S Save As... 另存为...
Ctrl+K S Save All 全部保存
Ctrl+F4 Close 关闭
Ctrl+K Ctrl+W Close All 关闭所有
Ctrl+Shift+T Reopen closed editor 重新打开关闭的编辑器
Ctrl+K Enter Keep preview mode editor open 保持上一个模式编辑器打开
Ctrl+Tab Open next 打开下一个
Ctrl+Shift+Tab Open previous 打开上一个
Ctrl+K P Copy path of active file 复制活动文件的路径
Ctrl+K R Reveal active file in Explorer 显示资源管理器中的活动文件
Ctrl+K O Show active file in new window/instance 显示新窗口/实例中的活动文件

# 显示 【Display】

快捷键 英文说明 中文说明
F11 Toggle full screen 切换全屏
Shift+Alt+0 Toggle editor layout (horizontal/vertical) 切换编辑器布局
Ctrl+ = / - Zoom in/out 放大/缩小
Ctrl+B Toggle Sidebar visibility 切换侧栏可见性
Ctrl+Shift+E Show Explorer / Toggle focus 显示浏览器/切换焦点
Ctrl+Shift+F Show Search 显示搜索
Ctrl+Shift+G Show Source Control 显示代码控制
Ctrl+Shift+D Show Debug 显示调试
Ctrl+Shift+X Show Extensions 显示扩展
Ctrl+Shift+H Replace in files 替换文件
Ctrl+Shift+J Toggle Search details 切换搜索详细信息
Ctrl+Shift+U Show Output panel 显示输出面板
Ctrl+Shift+V Open Markdown preview 打开Markdown预览
Ctrl+K V Open Markdown preview to the side 从旁边打开Markdown预览
Ctrl+K Z Zen Mode (Esc Esc to exit) 禅模式(按Esc键退出)

# 调试 【Debug】

快捷键 英文说明 中文说明
F9 Toggle breakpoint 切换断点
F5 Start/Continue 开始/继续
Shift+F5 Stop 停止
F11 / Shift+F11 Step into/out 下一步/上一步
F10 Step over 跳过
Ctrl+K Ctrl+I Show hover 显示悬停

# 集成终端 【Integrated terminal】

快捷键 英文说明 中文说明
Ctrl+` Show integrated terminal 显示集成终端
Ctrl+Shift+` Create new terminal 创建新终端
Ctrl+C Copy selection 复制选定
Ctrl+V Paste into active terminal 粘贴到活动终端
Ctrl+↑ / ↓ Scroll up/down 向上/向下滚动
Shift+PgUp / PgDown Scroll page up/down 向上/向下滚动页面
Ctrl+Home / End Scroll to top/bottom 滚动到顶部/底部

Other operating systems’ keyboard shortcuts and additional unassigned shortcuts available at code.visualstudio.com/docs/getstarted/keybindings (opens new window)

# Visual Studio Code官方英文快捷键大全

https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf

上次更新: 2021/2/6 00:42:10